<?php
    if (!isset($_SESSION)) {
        session_start();
    }
    if (isset($_SESSION['ERROR']) && $_SESSION['ERROR'] != '') {
        ?> <script type="text/javascript"> 
            alert('Usuario o contraseña invalidos');    
        </script>
        <?php
        $_SESSION['ERROR'] = '';
    }

    if (isset($_SESSION['autorizado'])) {
        if ($_SESSION['autorizado']) {
            $_SESSION['ERROR'] = '';
            ?>  <div id="contenedorGlobal"> <?php include("contenedorGlobalLoguiado.php"); ?> </div>  <?php
    } else {
            ?> <div id="contenedorGlobal"> <?php include("contenedorGlobal.php"); ?> </div> <?php
    }
} else {
    $_SESSION['autorizado'] = false;
    $_SESSION['ERROR'] = '';
        ?>  <div id="contenedorGlobal"> <?php include("contenedorGlobal.php"); ?> </div> <?php
}
    ?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="../CSS/portada.css"/>
        <link rel="stylesheet" href="../CSS/calendar.css"/>
        <script type="text/javascript" src="../JS/jquery-1.5.min.js"></script>
        <script type="text/javascript" src="../JS/dropdownmenu.js"></script>
        <script type="text/javascript" src="../JS/toastmessage.js"></script>
        <script type="text/javascript" src="../JS/calendar.js"></script> 
        <script type="text/javascript" src="../JS/funciones.js"></script>
        <script type="text/javascript" src="../JS/interpretadorAjax.js"></script>
        <script type="text/javascript" src="../JS/draganddrop.js"></script>
        <script type="text/javascript" src="../JS/json2.js"></script>
        <script  type="text/javascript" src="../JS/jquery.form.js"></script> 
        <script> 
            // wait for the DOM to be loaded 
            $(document).ready(function() { 
                // bind 'myForm' and provide a simple callback function 
                $('#login').ajaxForm(function() { 
                    document.forms["login"].submit();
                }); 
            }); 
           
        </script>
    </script>
    <title>Garaje</title>
</head>
<body>
    
    <script type="text/javascript"> 
        var menu=new menu.dd("menu");
        menu.init("menu","menuhover");
    </script> 
</body>
</html>
